class Word < ActiveRecord::Base
  has_many :word_stories
  has_many :stories, :through => :word_stories

  has_many :word_users
  has_many :users, :through => :word_users

  has_many :word_excluders, :through => :excluded_words, :source => :user

  has_many :categories
  has_many :category_words, :through => :categories, :source => :words
    
  validates_format_of :word,
                      :with => /^\w+$/,
                      :message => "cannot be blank"
                      
                      
                      
  #def self.excluding_duds
  #  self.find(:all,
  #            :joins => "LEFT JOIN duds ON words.id = duds.word_id",
  #            :conditions => "duds.word_id IS NULL")
  #end
  
end
